//
//  GattConstant.swift
//  Nexs
//
//  Created by roni on 2025/7/29.
//

import Foundation

// swiftlint:disable comment_spacing

// GATT Framed command
//0 bytes  1        2        3        4          5    len+4
//+--------+--------+--------+--------+ +--------+--------+
//|    VENDOR ID    |   COMMAND ID    | | PAYLOAD   ...   |
//+--------+--------+--------+--------+ +--------+--------+

// GATT Framed command
// MARK: - Gaia 常量定义
public struct GaiaConstants {
    /// GATT头部大小
    public static let gattHeaderSize = 4
    
    /// 命令ID偏移量
    public static let headerOffsetCommandId = 2
    
    /// 厂商ID偏移量
    public static let headerOffsetVendorId = 0
    
    /// 载荷偏移量
    public static let headerOffsetPayload = 4
    
    /// 命令掩码
    public static let commandMask: UInt16 = 0x7FFF
    
    /// ACK掩码
    public static let commandAckMask: UInt16 = 0x8000
    
    public static let vendorId: UInt16 = 0x000F
}

// swiftlint:enable comment_spacing
